<template>
  <div class="card_container">
    <div class="item_container" v-for="(item, index) in list" :key="index">
      <div class="img_container">
        <img :src="item.productImage" alt="" />
      </div>
      <div class="desc_container">
        
        <div>{{ item.productName }}</div>
        <div>{{ item.salePrice }}</div>
        <div>
          <el-button @click="addCart(item)">加</el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    list: String,
  },
};
</script>

<style scoped>
.card_container {
  width: 100%;
  height: 100%;
  display: inline-flex;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.item_container {
  width: 200px;
  height: 350px;
  /* border: 1px solid red; */
}

.img_container {
  width: 100%;
  height: 50%;
  display: inline-flex;
  justify-content: center;
}

.img_container img {
  height: 100%;
}

.desc_container {
  width: 100%;
  height: 50%;
  display: flex;
  flex-direction: column;
}

.desc_container > div {
  flex: 1;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
</style>